use "/Users/jrthornton/Desktop/Replication/anes_timeseries_2008" , clear
set more off




* year of study
gen year = 2008
* weight
gen w = V080101
******************
* SOPHISTICATION *
******************
* Created with three items: knowledge, interest, and involvement
		
* Knowledge (DONE)
gen interviewer_assesment = V083303
recode interviewer_assesment (-4=.) (-1=.) (1=5) (5=1) (2=4) (4=2)

* Interest (DONE)
gen interest_old_format = V083001a
replace interest_old = . if interest_old == -1
recode interest_old  (1=3) (3=2) (5=1)


gen interest_new_format = V083001b
replace interest_new = . if interest_new == -1
replace interest_new = . if interest_new == -2
replace interest_new = . if interest_new == -9
recode interest_new_format (5=1) (3=3) (1=5) (2=4) (4=2)

gen interest = interest_new
replace interest = interest_old if interest_new==.

* Involvement 
*Attendance at political events*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Attendm = V085030
recode Attendm (-2=.) (1=1) (5=0)
label var Attendm "Attend a Political Event"
label define Attendancem 0 "No" 1 "Yes" , replace
label values Attendm Attendancem

*Work for a political candidate*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Workm = V085032
recode Workm (-2=.) (1=1) (5=0)
label var Workm "Work for a Political Candidate"
label define Workedm 0 "No" 1 "Yes", replace
label values Workm Workedm

*Political expression in the form of a campaign button or sticker*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Displaym = V085031
recode Displaym (-2=.) (1=1) (5=0)
label var Displaym "Display a Campaign Button or Sticker"
label define Displaypoliticsm 0 "No" 1 "Yes" , replace
label values Displaym Displaypoliticsm

*Donation to a political candidate*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Donatecm = V085033
recode Donatecm (-2=.) (1=1) (5=0) (-8=.) (-9=.)
label var Donatecm "Donate money to a political candidate"
label define Donatecandidatem 0 "No" 1 "Yes" , replace
label values Donatecm Donatemoneycm

*Donation to a political party*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Donatepm = V085034
recode Donatepm (-2=.) (1=1) (5=0) (-8=.) (-9=.)
label var Donatepm "Donate money to a political party"
label define Donatepartym 0 "No" 1 "Yes" , replace
label values Donatepm Donatepartym

*Did R talk to anyone about voting for or against cand or pty to a political party*
*Note: This value is recoded so that higher values reflect greater* 
*political involvement*

gen Talk = V085029
recode Talk (-2=.) (1=1) (5=0) (-8=.)
label var Talk "Talk to to anyone for or against"
label define Talkm 0 "No" 1 "Yes" , replace
label values Talk Talkm



gen involvement=( Attendm+ Workm+ Displaym+ Donatecm+ Donatepm+ Talk)

gen house=V085066
recode house (-9=.) (-8=0) (-2=.) (1=1) (5=0)

	

*******************
* EQUALITARIANISM *
*******************
* Scale created from six tiems
	* 1. 'Our society should do whatever is necessary to make sure that 
			* everyone has an equal opportunity to succeed.'
	* 2. 'We have gone too far in pushing equal rights in this country.'
	* 3. 'One of the big problems in this country is that we don't give
			* everyone an equal chance.'
	* 4. 'It is not really that big a problem if some people have more of a
			* chance in life than others.'
	* 5. 'The (2004: This_ country would be better off if we worried less
			* about how equal people are.'		
	* 6. 'If people were treated more equally in this country we would have
			* many fewer problems.'
gen equality1 = V085162
recode equality1 (-8=.) (-9=.)
recode equality1 (1=5) (5=1) (2=4) (4=2)

gen equality2 = V085163
recode equality2 (-8=.) (-9=.)

gen equality3 = V085164
recode equality3 (-8=.) (-9=.)
recode equality3 (1=5) (5=1) (2=4) (4=2)

gen equality4 = V085165
recode equality4 (-8=.) (-9=.)

gen equality5 = V085166
recode equality5 (-8=.) (-9=.)

gen equality6 = V085167
recode equality6 (-8=.) (-9=.)
recode equality6 (1=5) (5=1) (2=4) (4=2)



*******************
* GROUP VARIABLES *
*******************
* Race
gen race = V083251a
recode race (-8=.) (-9=.) (50=1) (10=2) (40=3) (20=4) (30=4)(81=2) ///
	(82=4) (83=4) (84=3) (85=1) (90=4) 
label define racelabel 1 "White" 2 "Black" 3 "Hispanic" 4 "Other" 
label values race racelabel  
*1. White non-Hispanic
*2. Black non-Hispanic
*3. Hispanic
*4. Other or multiple races, non-Hispanic

* Gender
gen sex = V081101
recode sex (-9=.) (3=.)
replace sex = sex-1
label define sexlabel 0 "Male" 1 "Female" 
label values sex sexlabel




*********************
* CONTROL VARIABLES *
*********************
gen age = V083215x
recode age (-9=.) (-8=.)

gen educ = V083218x
recode educ (-9=.) (-8=.)
recode educ ///
	(0=1) (1=1) ///
	(2=2) ///
	(3=3) ///
	(4=4) (5=4) ///
	(6=5) (7=5)

gen income = V083248x
recode income (-9=.) (-5=.)

* Ideology
gen ideology = V083069
recode ideology (-9=.) (-9=.) (-7=.)

* Partisanship
gen pid = V083098x
recode pid (-1=.)
replace pid = pid+1
# delimit ; 
label define pid_label        
		1 "Strong Democrat" 
        2 "Weak Democrat" 
        3 "Independent - Democrat" 
        4 "Independent - Independent" 
        5 "Independent - Republican" 
		6 "Weak Republican" 
        7 "Strong Republican"
;
# delimit cr
label values pid pid_label

gen pidi = abs(pid-4)
# delimit ; 
label define pidi_label        
		0 "Independent" 
		1 "Weak partisan" 
        2 "Partisan" 
		3 "Strong partisan" 
;
# delimit cr
label values pidi pidi_label

gen democrat = 1 if pid<4


gen party = 0 if pid<4
replace party = 1 if pid==4
replace party = 2 if pid>4
label define partylabel 0 "Democrat" 1 "Independent" 2 "Republican" 
label values party partylabel

 

***************
* Homosexuals *
***************
*ISSUES: Strength of Position on Law to Protect Homosexuals Against Discrimination
gen gay_discrimination = V083211x	
recode gay_discrimination (-9=.) (-8=.)
revrs gay_discrimination , replace	
recode gay_discrimination (4=3) (5=4)

*ISSUES: Gay marriage
gen gay_marriage = V083214	
recode gay_marriage (-9=.) (-8=.) (7=.) (1=3) (3=1) (5=2)



*ISSUES: Should Gays/Lesbians Be Able to Adopt Children
gen gay_adopt = V083213	
recode gay_adopt (-9=.) (-8=.)	
recode gay_adopt (5=0)



gen therm_gays = V085064u
replace therm_gays = . if therm_gays<0




gen sexual_orientation = V083209
recode sexual_orientation (-9=.) (-8=.) (1=0) (3=1) (5=2)
label define orientation_label 0 "Straight" 1 "Gay" 2 "Bisexual" 
label values sexual_orientation orientation_label
gen gay = sexual_orientation
recode gay (2=1)
label define gay_label 0 "Straight" 1 "Gay or bisexual" 
label values gay gay_label

keep equality1 equality4 equality5 equality6 interviewer_assesment  interest_old interest_new  involvement gay_discrimination gay_marriage gay_adopt pidi age  educ sex year gay income party race gay ideo sex therm_gays house w
save "/Users/jrthornton/Desktop/Replication/2008_combined.dta" , replace

